function filenames = getStaticTestFilenames(directory,param)
% get static test stand filenames (with directory prefix)
% inputs: directory, param
% directory: the directory that files are in
% param: 'normal' = gets standard tests, ignores anything with
% 'water','density','corn','sugar','salt','vol','groupTA' to ensure only standard tests


if nargin == 1
    param = 'normal';
    
elseif nargin == 0
    directory = 'staticTestData';
    param = 'normal';
end

% get check strings (must be in file name) and ignore strings (must not be
% in file name) for given param
if strcmp(param,'normal')
    checkStrings = {'Group'};
    ignoreStrings = {'water','density','corn','sugar','salt','vol','groupTA'};
else
    error('Not a valid search parameter');
end


% get everything in directory
dirdata = dir(directory);
% length of stuff to check
ndata = length(dirdata);
nchecks = length(checkStrings);
nignores = length(ignoreStrings);

filenames = {};

ind = 0;
wh = waitbar(0,'Checking Filenames');
for i = 1:ndata
    if ~rem(i,2)
        waitbar(i/ndata,wh,'Checking Filenames');
    end
    
    if ~dirdata(i).isdir %ignore stuff thats also a directory
        gotChecks = ones(nchecks,1);
        gotIgnores = zeros(nignores,1);
        
        %check to see whether it contains all the check strings
        for j = 1:nchecks
            if isempty(regexp(lower(dirdata(i).name),lower(checkStrings{j}),'once'))
                % means didn't find check strings
                gotChecks(j) = 0;
            end
        end
        
        %check to see whether it contains any ignore strings
        for j = 1:nignores
            if ~isempty(regexp(lower(dirdata(i).name),lower(ignoreStrings{j}),'once'))
                gotIgnores(j) = 1;
            end
        end
        
        
        
        
        %check to see if we got all checks and didn't get any ignores and
        %has data in file
        if all(gotChecks) && ~any(gotIgnores)
            % also check to see whether any data exists
            testdata = load([directory '/' dirdata(i).name]);
%             testdata = dlmread([directory '/' dirdata(i).name],
            gotdata = norm(size(testdata)); %if the norm of the size is zero, means both sizes were zero
            if gotdata
                ind = ind+1;
                filenames{ind} = [directory '/' dirdata(i).name];
            end
        end
    end
end
close(wh);
                
        